import request from '@/utils/request'

export default {
    // //获取标准数据
    getSamplingList(info){
      return request({
        url:'/sampling/list',
        method:'post',
        data:info
      })
    },
    // //根据id获取标准数据
    getSamplingById(id){
      return request({
        url:'/sampling/' + id,
        method:'get'
      })
    },
    // //保存数据
    saveList(sampling){
      if (sampling.id == null && sampling.id === undefined){
        return this.addStandard(sampling);
      }else{
        return this.updateStandard(sampling);
      }
    },
    // //新增标准
    addStandard(sampling) {
      return request({
        url: '/sampling',
        method: 'post',
        data:sampling
      })
    },
    // //修改标准
    updateStandard(sampling) {
      return request({
        url: '/sampling',
        method: 'put',
        data:sampling
      })
    },
    // //删除标准
    delStandardById(id){
      return request({
        url:'/sampling/' + id,
        method:'delete',
      })
    }
}
